/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cc.altius.model;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import javax.persistence.*;

/**
 *
 * @author sagar
 */
@Entity
@Table(name = "hospital")
@NamedQueries({
    @NamedQuery(name = "Hospital.findAll", query = "SELECT h FROM Hospital h"),
    @NamedQuery(name = "Hospital.findByHospitalId", query = "SELECT h FROM Hospital h WHERE h.hospitalId = :hospitalId"),
    @NamedQuery(name = "Hospital.findByHospitalName", query = "SELECT h FROM Hospital h WHERE h.hospitalName = :hospitalName"),
    @NamedQuery(name = "Hospital.findByLevel", query = "SELECT h FROM Hospital h WHERE h.level = :level"),
    @NamedQuery(name = "Hospital.findByBedDesc", query = "SELECT h FROM Hospital h WHERE h.bedDesc = :bedDesc"),
    @NamedQuery(name = "Hospital.findByTieUpStage", query = "SELECT h FROM Hospital h WHERE h.tieUpStage = :tieUpStage"),
    @NamedQuery(name = "Hospital.findByIpd", query = "SELECT h FROM Hospital h WHERE h.ipd = :ipd"),
    @NamedQuery(name = "Hospital.findByOpd", query = "SELECT h FROM Hospital h WHERE h.opd = :opd"),
    @NamedQuery(name = "Hospital.findByDayCare", query = "SELECT h FROM Hospital h WHERE h.dayCare = :dayCare"),
    @NamedQuery(name = "Hospital.findByDiagnostics", query = "SELECT h FROM Hospital h WHERE h.diagnostics = :diagnostics"),
   
    @NamedQuery(name = "Hospital.findByContact1", query = "SELECT h FROM Hospital h WHERE h.contact1 = :contact1"),
    @NamedQuery(name = "Hospital.findByContact2", query = "SELECT h FROM Hospital h WHERE h.contact2 = :contact2"),
    @NamedQuery(name = "Hospital.findByContact3", query = "SELECT h FROM Hospital h WHERE h.contact3 = :contact3"),
    @NamedQuery(name = "Hospital.findByLatitude", query = "SELECT h FROM Hospital h WHERE h.latitude = :latitude"),
    @NamedQuery(name = "Hospital.findByLongitude", query = "SELECT h FROM Hospital h WHERE h.longitude = :longitude")})
public class Hospital implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "HOSPITAL_ID")
    private Integer hospitalId;
    @Column(name = "HOSPITAL_NAME")
    private String hospitalName;
    @Column(name = "LEVEL")
    private Integer level;
    @Column(name = "BED_DESC")
    private String bedDesc;
    @Column(name = "TIE_UP_STAGE")
    private Integer tieUpStage;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "IPD")
    private BigDecimal ipd;
    @Column(name = "OPD")
    private BigDecimal opd;
    @Column(name = "DAY_CARE")
    private BigDecimal dayCare;
    @Column(name = "DIAGNOSTICS")
    private BigDecimal diagnostics;
    @Column(name = "AMBULANCE_SERVICE")
    private String ambulanceService;
//    @JoinColumn(name = "AMBULANCE_SERVICE_ID", referencedColumnName = "AMBULANCE_SERVICE_ID")
//    @ManyToOne(optional = false)
//    private AmbulanceSer ambulanceServiceId;

    
    @Column(name = "CONTACT_1")
    private String contact1;
    @Column(name = "CONTACT_2")
    private String contact2;
    @Column(name = "CONTACT_3")
    private String contact3;
    
    @Column(name = "CONTACT_SMS")
    private String contactSms;
     @Column(name = "CONTACT_NAME")
    private String contactName;

    public String getContactName() {
        return contactName;
    }

    public void setContactName(String contactName) {
        this.contactName = contactName;
    }

    public String getContactSms() {
        return contactSms;
    }

    public void setContactSms(String contactSms) {
        this.contactSms = contactSms;
    }
   
    @Column(name = "LATITUDE")
    private Double latitude;
    @Column(name = "LONGITUDE")
    private Double longitude;
//    @OneToMany(mappedBy = "hospitalId")
//    private List<Specialist> specialistList;
    @JoinColumn(name = "ZONE_ID", referencedColumnName = "ZONE_ID")
    @ManyToOne(optional = false)
    private Zone zoneId;
    @Column(name = "HOSPITAL_ADDRESS")
    private String hospitalAddress;
    @Column(name = "SPECIALITY")
    private String speciality;
    @Basic(optional = false)
    @Column(name = "IS_INSURANCE")
    private boolean isInsurance;
    @Basic(optional = false)
    @Column(name = "DEPOSIT_LESS")
    private boolean depositLess;
    public boolean isDepositLess() {
        return depositLess;
    }

    public void setDepositLess(boolean depositLess) {
        this.depositLess = depositLess;
    }

    public boolean isIsInsurance() {
        return isInsurance;
    }

    public void setIsInsurance(boolean isInsurance) {
        this.isInsurance = isInsurance;
    }
    

    public String getSpeciality() {
        return speciality;
    }

    public void setSpeciality(String speciality) {
        this.speciality = speciality;
    }

    public String getHospitalAddress() {
        return hospitalAddress;
    }

    public void setHospitalAddress(String hospitalAddress) {
        this.hospitalAddress = hospitalAddress;
    }

    public Hospital() {
    }

    public Hospital(Integer hospitalId) {
        this.hospitalId = hospitalId;
    }

    public Integer getHospitalId() {
        return hospitalId;
    }

    public void setHospitalId(Integer hospitalId) {
        this.hospitalId = hospitalId;
    }

    public String getHospitalName() {
        return hospitalName;
    }

    public void setHospitalName(String hospitalName) {
        this.hospitalName = hospitalName;
    }

    public Integer getLevel() {
        return level;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }

    public String getBedDesc() {
        return bedDesc;
    }

    public void setBedDesc(String bedDesc) {
        this.bedDesc = bedDesc;
    }

    public Integer getTieUpStage() {
        return tieUpStage;
    }

    public void setTieUpStage(Integer tieUpStage) {
        this.tieUpStage = tieUpStage;
    }

    public BigDecimal getIpd() {
        return ipd;
    }

    public void setIpd(BigDecimal ipd) {
        this.ipd = ipd;
    }

    public BigDecimal getOpd() {
        return opd;
    }

    public void setOpd(BigDecimal opd) {
        this.opd = opd;
    }

    public BigDecimal getDayCare() {
        return dayCare;
    }

    public void setDayCare(BigDecimal dayCare) {
        this.dayCare = dayCare;
    }

    public BigDecimal getDiagnostics() {
        return diagnostics;
    }

    public void setDiagnostics(BigDecimal diagnostics) {
        this.diagnostics = diagnostics;
    }

    public String getAmbulanceService() {
        return ambulanceService;
    }

    public void setAmbulanceService(String ambulanceService) {
        this.ambulanceService = ambulanceService;
    }
    public String getContact1() {
        return contact1;
    }

    public void setContact1(String contact1) {
        this.contact1 = contact1;
    }

    public String getContact2() {
        return contact2;
    }

    public void setContact2(String contact2) {
        this.contact2 = contact2;
    }

    public String getContact3() {
        return contact3;
    }

    public void setContact3(String contact3) {
        this.contact3 = contact3;
    }

    public Double getLatitude() {
        return latitude;
    }

    public void setLatitude(Double latitude) {
        this.latitude = latitude;
    }

    public Double getLongitude() {
        return longitude;
    }

    public void setLongitude(Double longitude) {
        this.longitude = longitude;
    }

//    public List<Specialist> getSpecialistList() {
//        return specialistList;
//    }
//
//    public void setSpecialistList(List<Specialist> specialistList) {
//        this.specialistList = specialistList;
//    }

    public Zone getZoneId() {
        return zoneId;
    }

    public void setZoneId(Zone zoneId) {
        this.zoneId = zoneId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (hospitalId != null ? hospitalId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Hospital)) {
            return false;
        }
        Hospital other = (Hospital) object;
        if ((this.hospitalId == null && other.hospitalId != null) || (this.hospitalId != null && !this.hospitalId.equals(other.hospitalId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Hospital{" + "hospitalId=" + hospitalId + ", hospitalName=" + hospitalName + ", level=" + level + ", tieUpStage=" + tieUpStage + ", contact1=" + contact1 + ", hospitalAddress=" + hospitalAddress + ", isInsurance=" + isInsurance + ", depositLess=" + depositLess + '}';
    }

}
